package com.senior.sendmessage.controller;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.senior.sendmessage.entity.Person;
import com.senior.sendmessage.service.PersonService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Baijl
 * @version 0.0.1
 * @date 2021-06-22 11:27
 * @description TODO
 */
@RestController
@RequiredArgsConstructor
public class PersonController {
    private final PersonService personService;


    @GetMapping("/add")
    public void addPerson() {
        Person build = Person.builder().name("杨玉环").age(1).degree("研究生").createTime(LocalDateTimeUtil.now()).build();
        personService.save(build);
    }
}
